package com.yatb.trac.pojo.condition;

import java.util.HashMap;
import java.util.Map;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

import com.yatb.trac.util.SQLCondition;

public class FindAllegatiBySessionIdAndTemporaneo implements SQLCondition {
	
	private String sessionId;
	private Boolean temporaneo;

	public FindAllegatiBySessionIdAndTemporaneo(String sessionId,
			Boolean temporaneo) {
		super();
		this.sessionId = sessionId;
		this.temporaneo = temporaneo;
	}

	public Criterion create(Object... params) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("sessioneUtente", sessionId);
		parameters.put("temporaneo", temporaneo);
		
		return Restrictions.allEq(parameters);
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public Boolean getTemporaneo() {
		return temporaneo;
	}

	public void setTemporaneo(Boolean temporaneo) {
		this.temporaneo = temporaneo;
	}

}
